<!DOCTYPE html>
<html>

<head>
  <meta charset="utf-8">
  <title><%= options.title || 'Storybook'%></title>

  <% if (files.favicon) { %>
    <link rel="shortcut icon" href="<%= files.favicon%>">
  <% } %>

  <meta name="viewport" content="width=device-width, initial-scale=1">

  <% if (typeof headHtmlSnippet !== 'undefined') { %>
    <%= headHtmlSnippet %>
  <% } %>

  <% files.css.forEach(file => { %>
    <link href="<%= file %>" rel="stylesheet">
  <% }); %>
  
</head>
<body>

<% if (typeof bodyHtmlSnippet !== 'undefined') { %>
  <%= bodyHtmlSnippet %>
<% } %>

<div id="root"></div>

<% if (options.window) { %>
<script>
  <% for (var varName in options.window) { %>
    window['<%=varName%>'] = <%= JSON.stringify(options.window[varName]) %>;
  <% } %>
</script>
<% } %>

<% dlls.forEach(file => { %>
  <script src="<%= file %>"></script>
<% }); %>

<% files.js.forEach(file => { %>
  <script src="<%= file %>"></script>
<% }); %>

</body>
</html>
